<?php include('./templete/public/head.php') ?>

<body>

<hr class="bgcolor"/>
<!--发布金点子-->
<div class="fabu-main fabu-idea-main">
    <div class="main-content">
        <div class="c-list">
            <form id="myform">
                <ul class="comm-table-view">
                    <li class="table-view-cell table-view-cell2">
                        <a>
                            <span>完成内容</span>
                            <div class="fabu-text">
                                <textarea name="complete_content" id="complete_content"></textarea>
                            </div>
                            <div class="fabu-upload">
                                <img src="_images/icon/upload.jpg" class="showPopover _file_upload"/>
                                <p class="_action"></p>
                                <p class="_action1" onclick="get_file(this)"></p>
                            </div>
                            <button type="button" class="layui-btn _file_uploads"  style="display: none">
                            </button>
                            <input type="hidden" name="file_url" id="file_url1" class="_file_url" >
                        </a>
                    </li>
                    <li class="table-view-cell table-view-cell2">
                        <a>
                            <div class="fabu-upload">
                                <img src="_images/icon/upload.jpg" class="showPopover _file_upload"/>
                                <p class="_action"></p>
                                <p class="_action1" onclick="get_file(this)"></p>
                            </div>
                            <button type="button" class="layui-btn _file_uploads"  style="display: none">
                            </button>
                            <input type="hidden" name="file_url" id="file_url2" class="_file_url" >
                        </a>
                    </li>
                    <li class="table-view-cell table-view-cell2">
                        <a>
                            <div class="fabu-upload">
                                <img src="_images/icon/upload.jpg" class="showPopover _file_upload"/>
                                <p class="_action"></p>
                                <p class="_action1" onclick="get_file(this)"></p>
                            </div>
                            <button type="button" class="layui-btn _file_uploads"  style="display: none">
                            </button>
                            <input type="hidden" name="file_url" id="file_url3" class="_file_url" >
                        </a>
                    </li>
                </ul>
            </form>
            <div class="comm-btn comm-btn2 fabu-btn">
                <span class="color1 publish">提交</span>
                <!--                <span class="color2">越级提交</span>-->
            </div>
        </div>
    </div>
</div>

</body>
<script>

    $('._file_upload').click(function () {
        var oThis = $(this).parent().next();
        console.log(oThis);
        oThis.click();
    });

    $(".publish").click(function () {
        if (!$('#complete_content').val()) {
            layer.msg('请输入完成内容');
            return false;
        }
        $.ajax({
            url: '<?php echo url('finish_jdz')?>',
            type: 'post',
            data: {
                finish_content: $('#complete_content').val(),
                jdz_id:<?php echo input('id')?>,
                file_url1 : $('#file_url1').val(),
                file_url2 : $('#file_url2').val(),
                file_url3 : $('#file_url3').val()
            },
            success: function (data) {
                layer.msg(data.msg);
               setTimeout(function () {
                   location.href="<?php echo url('jdz/detail',['id'=>input('id')])?>"
               }, 1000);
            }

        })
    });
</script>

</html>